#!/bin/csh 
#.................................................................................................

setenv NCARG_ROOT  /Users/zhan524/tools/ncl_ncarg-6.0.0.MacOS_10.6_64bit_nodap_gcc421 
setenv NCARG_ROOT  /share/apps/ncl/6.0.0/gnu

setenv makeplot "T" 
setenv plotform "pdf" 
setenv plotview "png" 


if ($makeplot == "T") then 

echo OK 


###cat > load_setup.ncl << EOF
###
###  plotfmt = "$plotform"
###  shortname = "presc_dustPI_X0006A-X0010A" 
###
###  ca = "X0010A"
###  cb = "X0006A"
###
###  na = "presc BN dust PI" 
###  nb = "presc BN PD" 
###
###  basepa = "/pic/scratch/zhan524/"
###  basepb = "/pic/scratch/zhan524/"
###
###  ma = ".cam2.h0.0003-0007.ANN.nc" 
###  mb = ".cam2.h0.0003-0007.ANN.nc" 
###
###EOF
###
###
###foreach exe (*.ncl)
###   echo ncl $exe
###   ncl $exe
###end
###
###
####.................................................................................................
###
###cat > load_setup.ncl << EOF
###
###  plotfmt = "$plotform"
###  shortname = "presc_nudge_cam5_X0021-X0024" 
###
###  ca = "X0024"
###  cb = "X0021"
###
###  na = "X0024" ;;presc BN PI" 
###  nb = "X0021" ;;presc BN PD" 
###
###  basepa = "/pic/scratch/zhan524/"
###  basepb = "/pic/scratch/zhan524/"
###
###  ma = ".cam2.h0.2000.ANN.nc" 
###  mb = ".cam2.h0.2000.ANN.nc" 
###
###EOF
###
###
###foreach exe (*.ncl)
###   echo ncl $exe
###   ncl $exe
###end
###
####.................................................................................................
###
###cat > load_setup.ncl << EOF
###
###  plotfmt = "$plotform"
###  shortname = "presc_nudge_cam5_X0021-X0023" 
###
###  ca = "X0023"
###  cb = "X0021"
###
###  na = "X0023" ;;presc BN PI" 
###  nb = "X0021" ;;presc BN PD" 
###
###  basepa = "/pic/scratch/zhan524/"
###  basepb = "/pic/scratch/zhan524/"
###
###  ma = ".cam2.h0.2000.ANN.nc" 
###  mb = ".cam2.h0.2000.ANN.nc" 
###
###EOF
###
###
###foreach exe (*.ncl)
###   echo ncl $exe
###   ncl $exe
###end
###
####.................................................................................................
###
###cat > load_setup.ncl << EOF
###
###  plotfmt = "$plotform"
###  shortname = "presc_nudge_cam5_X0021-X0022_1999" 
###
###  ca = "X0022"
###  cb = "X0021"
###
###  na = "X0022" ;;presc BN PI" 
###  nb = "X0021" ;;presc BN PD" 
###
###  basepa = "/pic/scratch/zhan524/"
###  basepb = "/pic/scratch/zhan524/"
###
###  ma = ".cam2.h0.1999.ANN.nc" 
###  mb = ".cam2.h0.1999.ANN.nc" 
###
###EOF
###
###
###foreach exe (*.ncl)
###   echo ncl $exe
###   ncl $exe
###end
###
####.................................................................................................
###
###cat > load_setup.ncl << EOF
###
###  plotfmt = "$plotform"
###  shortname = "presc_nudge_maxvw3_X0008A-X0008B" 
###
###  ca = "X0008B"
###  cb = "X0008A"
###
###  na = "X0008B" ;;presc BN PI" 
###  nb = "X0008A" ;;presc BN PD" 
###
###  basepa = "/pic/scratch/zhan524/"
###  basepb = "/pic/scratch/zhan524/"
###
###  ma = ".cam2.h0.0003-0007.ANN.nc" 
###  mb = ".cam2.h0.0003-0007.ANN.nc" 
###
###EOF
###
###
###foreach exe (*.ncl)
###   echo ncl $exe
###   ncl $exe
###end
###
####.................................................................................................
###
###cat > load_setup.ncl << EOF
###
###  plotfmt = "$plotform"
###  shortname = "presc_contPI_X0006A-X0009A" 
###
###  ca = "X0009A"
###  cb = "X0006A"
###
###  na = "presc BN cont PI" 
###  nb = "presc BN PD" 
###
###  basepa = "/pic/scratch/zhan524/"
###  basepb = "/pic/scratch/zhan524/"
###
###  ma = ".cam2.h0.0003-0007.ANN.nc" 
###  mb = ".cam2.h0.0003-0007.ANN.nc" 
###
###EOF
###
###
###foreach exe (*.ncl)
###   echo ncl $exe
###   ncl $exe
###end
###
####.................................................................................................
###
###cat > load_setup.ncl << EOF
###
###  plotfmt = "$plotform"
###  shortname = "presc_maxvw3_X0006A-X0008A" 
###
###  ca = "X0008A"
###  cb = "X0006A"
###
###  na = "presc BN PD zerodust maxvw3" 
###  nb = "presc BN PD" 
###
###  basepa = "/pic/scratch/zhan524/"
###  basepb = "/pic/scratch/zhan524/"
###
###  ma = ".cam2.h0.0003.ANN.nc" 
###  mb = ".cam2.h0.0003.ANN.nc" 
###
###EOF
###
###
###foreach exe (*.ncl)
###   echo ncl $exe
###   ncl $exe
###end
###
###
####.................................................................................................
###
###cat > load_setup.ncl << EOF
###
###  plotfmt = "$plotform"
###  shortname = "presc_nudge_check_X0011-X0006A" 
###
###  ca = "X0006A"
###  cb = "X0011"
###
###  na = "clim presc BN PD" 
###  nb = "nudge presc BN PD" 
###
###  basepa = "/pic/scratch/zhan524/"
###  basepb = "/pic/scratch/zhan524/"
###
###  ma = ".cam2.h0.0003-0007.ANN.nc" 
###  mb = ".cam2.h0.2001.ANN.nc" 
###
###EOF
###
###
###foreach exe (*.ncl)
###   echo ncl $exe
###   ncl $exe
###end
###
#.................................................................................................
###
###cat > load_setup.ncl << EOF
###
###  plotfmt = "$plotform"
###  shortname = "presc_nudge_piice_pddust_picont_X0014-X0011" 
###
###  ca = "X0014"
###  cb = "X0011"
###
###  na = "X0014" ;;nudge presc BN nofixdust fixcont PI" 
###  nb = "X0011" ;;nudge presc BN PD" 
###
###  basepa = "/pic/scratch/zhan524/"
###  basepb = "/pic/scratch/zhan524/"
###
###  ma = ".cam2.h0.2001.ANN.nc" 
###  mb = ".cam2.h0.2001.ANN.nc" 
###
###EOF
###
###
###foreach exe (*.ncl)
###   echo ncl $exe
###   ncl $exe
###end
###
###
####.................................................................................................
###
###cat > load_setup.ncl << EOF
###
###  plotfmt = "$plotform"
###  shortname = "presc_nudge_piice_pddust_pdcont_nodropfrz_X0015-X0016" 
###
###  ca = "X0016"
###  cb = "X0015"
###
###  na = "X0016" ;;nudge presc BN PI cont PD" 
###  nb = "X0015" ;;nudge presc BN PD" 
###
###  basepa = "/pic/scratch/zhan524/"
###  basepb = "/pic/scratch/zhan524/"
###
###  ma = ".cam2.h0.2001.ANN.nc" 
###  mb = ".cam2.h0.2001.ANN.nc" 
###
###EOF
###
###
###foreach exe (*.ncl)
###   echo ncl $exe
###   ncl $exe
###end
###
####.................................................................................................
###
###cat > load_setup.ncl << EOF
###
###  plotfmt = "$plotform"
###  shortname = "presc_nudge_piice_pddust_pdcont_maxvw3_X0017-X0018" 
###
###  ca = "X0018"
###  cb = "X0017"
###
###  na = "X0018" ;;nudge presc BN PI cont PD" 
###  nb = "X0017" ;;nudge presc BN PD" 
###
###  basepa = "/pic/scratch/zhan524/"
###  basepb = "/pic/scratch/zhan524/"
###
###  ma = ".cam2.h0.2001.ANN.nc" 
###  mb = ".cam2.h0.2001.ANN.nc" 
###
###EOF
###
###
###foreach exe (*.ncl)
###   echo ncl $exe
###   ncl $exe
###end
###
####.................................................................................................
###
###cat > load_setup.ncl << EOF
###
###  plotfmt = "$plotform"
###  shortname = "presc_nudge_piice_pidust_pdcont_X0013-X0011" 
###
###  ca = "X0013"
###  cb = "X0011"
###
###  na = "X0013" ;;nudge presc BN PI cont PD" 
###  nb = "X0011" ;;nudge presc BN PD" 
###
###  basepa = "/pic/scratch/zhan524/"
###  basepb = "/pic/scratch/zhan524/"
###
###  ma = ".cam2.h0.2001.ANN.nc" 
###  mb = ".cam2.h0.2001.ANN.nc" 
###
###EOF
###
###
###foreach exe (*.ncl)
###   echo ncl $exe
###   ncl $exe
###end
###
####.................................................................................................
###
###cat > load_setup.ncl << EOF
###
###  plotfmt = "$plotform"
###  shortname = "presc_nudge_piice_pddust_pdcont_X0012-X0011" 
###
###  ca = "X0012"
###  cb = "X0011"
###
###  na = "X0012" ;;nudge presc BN PI pddust pdcont" 
###  nb = "X0011" ;;nudge presc BN PD" 
###
###  basepa = "/pic/scratch/zhan524/"
###  basepb = "/pic/scratch/zhan524/"
###
###  ma = ".cam2.h0.2001.ANN.nc" 
###  mb = ".cam2.h0.2001.ANN.nc" 
###
###EOF
###
###
###foreach exe (*.ncl)
###   echo ncl $exe
###   ncl $exe
###end
###
###
#.................................................................................................
###
###cat > load_setup.ncl << EOF
###
###  plotfmt = "$plotform"
###  shortname = "presc_piice_pddust_pdcont_X0006A-X0007A" 
###
###  ca = "X0007A"
###  cb = "X0006A"
###
###  na = "presc BN fixdust PI" 
###  nb = "presc BN fixdust PD" 
###
###  basepa = "/pic/scratch/zhan524/"
###  basepb = "/pic/scratch/zhan524/"
###
###  ma = ".cam2.h0.0003-0007.ANN.nc" 
###  mb = ".cam2.h0.0003-0007.ANN.nc" 
###
###EOF
###
###
###foreach exe (*.ncl)
###   echo ncl $exe
###   ncl $exe
###end


endif

#.................................................................................................
# convert to other format 
#.................................................................................................
 
if($plotform == "eps") then
if($plotview == "png") then
   foreach ff (*.eps)
      echo $ff.png
      convert -density 200 $ff $ff.png
   end
endif
endif

mv -f *.png plot_png 
mv -f *.eps plot_eps 
mv -f *.pdf plot_pdf



